package sk.stuba.fiit.arthur.ws.service;

import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import sk.stuba.fiit.arthur.ws.schema.beans.GetPersonsRequest;
import sk.stuba.fiit.arthur.ws.schema.beans.Person;
import sk.stuba.fiit.arthur.ws.schema.beans.PersonResponse;


/**
 * Person service endpoint.
 * 
 * @author Marek Hruska
 */
@Endpoint
public class PersonEndpoint implements MarshallingPersonService {
    
    /**
     * Gets person list.
     */
    @PayloadRoot(localPart=GET_PERSONS_REQUEST, namespace=NAMESPACE)
    public PersonResponse getPersons(GetPersonsRequest request) {
        return new PersonResponse().withPerson(
                   new Person().withId(1).withFirstName("Joe").withLastName("Smith"),
                   new Person().withId(2).withFirstName("John").withLastName("Jackson"));        
    }
}
